body {
  margin: 0;
  background: #111;
  color: white;
  text-align: center;
  font-family: Arial, sans-serif;
}

#game {
  width: 400px;
  height: 200px;
  margin: 20px auto;
  border: 3px solid white;
  position: relative;
  overflow: hidden;
  background: linear-gradient(#222, #000);
}

/* Player as cyan square */
#player {
  width: 30px;
  height: 30px;
  background: cyan;
  position: absolute;
  bottom: 0;
  left: 50px;
}

/* Spike obstacle */
.spike {
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-bottom: 30px solid red;
  position: absolute;
  bottom: 0;
  left: 400px;
  animation: move 2s linear infinite;
}

/* Movement animation */
@keyframes move {
  0% { left: 400px; }
  100% { left: -30px; }

}

/* Jump animation */
.jump {
  animation: jump 0.5s ease;
}

@keyframes jump {
  0% { bottom: 0; }
  50% { bottom: 80px; }
  100% { bottom: 0; }
}